package com.igit.contact.action;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.gosophia.organizationManagement.dto.PositionDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;
import com.opensymphony.xwork2.ActionSupport;

/**
 * 组织机构操作的action
 * 
 * @author guodp
 * 
 */
@Controller("orgPosisioAction")
@Scope("prototype")
public class OrgPosisioAction extends ActionSupport {

	private static final long serialVersionUID = 1L;

	@Autowired
	private OrganizationManagementWebService organizationManagementWebService;

	private Long orgId;

	private List<PositionDTO> positionList = null;

	/**
	 * 根据机构ID查询机构下的职位
	 * 
	 * @return
	 */
	public String findPositionByOrgId() {
		positionList = organizationManagementWebService
				.findCertainPositionByOrgId(orgId);
		return SUCCESS;
	}

	public Long getOrgId() {
		return orgId;
	}

	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}

	public List<PositionDTO> getPositionList() {
		return positionList;
	}

	public void setPositionList(List<PositionDTO> positionList) {
		this.positionList = positionList;
	}

}
